<?php
/**
 * Created by PhpStorm.
 * User: 氓羽
 * Date: 2018-5-2
 * Time: 11:01
 */

function C($name, $method){
    require_once ('./libs/Controller/'.$name.'Controller.class.php');
    $controller = $name.'Controller';
    $obj = new $controller();
    $obj->$method();
}

function M($name){
    require_once ('./libs/Model/'.$name.'Model.class.php');
    $model = $name.'Model';
    $obj = new $model;
    return $obj;
}

function V($name){
    require_once ('./libs/View/'.$name.'View.class.php');
    $view = $name.'View';
    $obj = new $view;
    return $obj;
}

function ORG($path, $name, $params=array()){
    require_once ('libs/ORG/'.$path.$name.'.class.php');
    $obj = new $name();
    if(!empty($params)){
        foreach ($params as $key=>$value){
            $obj->$key($value);
        }
    }
    return $obj;
}